package com.leo.mapper.impl;
import com.leo.mapper.UserInfoMapper;
import com.leo.model.UserInfo;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: UserInfoMapperImpl
 * @Description: mapper的实现类
 * @Author: leo825
 * @Date: 2020-05-19 16:38
 * @Version: 1.0
 */
@Service
public class UserInfoMapperImpl extends BaseMapperImpl implements UserInfoMapper {

    UserInfoMapperImpl(SqlSessionFactory sqlSessionFactory) {
        super(sqlSessionFactory);
    }

    @Override
    public void insertUserInfo(UserInfo userInfo) {
        this.getSqlSession().insert("com.leo.mapper.UserInfoMapper.insertUserInfo", userInfo);
    }

    @Override
    public void deleteUserInfo(Integer id) {
        this.getSqlSession().delete("com.leo.mapper.UserInfoMapper.deleteUserInfo", id);
    }

    @Override
    public void updateUserInfo(UserInfo newUserInfo) {
        this.getSqlSession().update("com.leo.mapper.UserInfoMapper.updateUserInfo", newUserInfo);
    }

    @Override
    public List<UserInfo> getUserInfoList() {
        return this.getSqlSession().selectList("com.leo.mapper.UserInfoMapper.getUserInfoList");
    }
}
